package com.itheima.advance.reflect.demo04;

import java.lang.reflect.Method;

public class ReflectDemo02 {

    public static void main(String[] args) throws Exception {

        Class<?> studentClass = Class.forName("com.itheima.advance.reflect.demo04.Student");
        Method function4 = studentClass.getDeclaredMethod("function4", String.class);
        Student student = (Student) studentClass.newInstance();
        String s = (String) function4.invoke(student, "蓝湛");
        System.out.println(s);
    }
}
